package com.atguigu.lease.common.context;
/*
*   维护ThreadLocal本地线程对象
* */
public class LoginUserContext {

    private static ThreadLocal<LoginUser> threadLocal = new ThreadLocal<>();

    //向ThreadLocal对象保存token负载信息
    public static void set(LoginUser loginUser){
        threadLocal.set(loginUser );
    }


    //从ThreadLocal对象获取token负载信息
    public static LoginUser get() {
        return threadLocal.get();
    }


    //删除ThreadLocal对象中保存的token负载信息
    public static void remove(){
        threadLocal.remove();
    }
}
